/*
 * Copyright Konstantin Triger <kostat@gmail.com> 
 * 
 * This file is part of Jaque 2 JPA - JAva QUEry 2 JPA library <http://code.google.com/p/jaque/>.
 * 
 * Jaque is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Jaque is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package jaque.jpa;

import java.util.List;

import javax.persistence.*;

@Entity
@Table(name = "Customers")
public class Customer {

	public Customer() {
	}

	public void setCustomerID(String customerID) {
		this._customerID = customerID;
	}

	@Id
	@Column(name = "CustomerID")
	public String getCustomerID() {
		return _customerID;
	}

	public void setContactName(String contactName) {
		_contactName = contactName;
	}

	@Column(name = "ContactName")
	public String getContactName() {
		return _contactName;
	}

	public void setPhone(String phone) {
		_phone = phone;
	}

	@Column(name = "Phone")
	public String getPhone() {
		return _phone;
	}

	public void setCity(String city) {
		_city = city;
	}

	@Column(name = "City")
	public String getCity() {
		return _city;
	}

	public void setCountry(String country) {
		_country = country;
	}

	@Column(name = "Country")
	public String getCountry() {
		return _country;
	}

	@OneToMany(mappedBy = "customer", targetEntity = Order.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	// @JoinColumn(name="CustomerID")
	public List<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(List<Order> value) {
		this.orders = value;
	}

	// @Id
	// @Column(name="CustomerID")
	private String _customerID;

	// @Column(name="ContactName")
	private String _contactName;

	// @Column(name="Phone")
	private String _phone;

	// @Column(name="City")
	private String _city;

	// @Column(name="Country")
	private String _country;

	private List<Order> orders;
}
